
	
		






//加载学员信息
function showMessage(){
	$.ajax({
		url:"/vi_user_student/selectByUid",
		type:"post",
		success:function(data){
			//改变头像图片源
			
			if(data.headImage=="" || data.headImage==null){
				
				$("#my-img").attr("src", "/images/滑稽.png");
			
			}
			else{
				$("#my-img").attr("src", "/images/" + data.headImage);
				}
			
			
			
			
			// 通过改变 text的value值来显示的信息
			var val="";
			var content ='<div class="layui-form-item" style="font-size: 20px; text-align: center" >基本信息</div>';
			var nickName ='<label class="layui-form-label" ">昵称</label>'
				+'<div class="layui-input-inline">';
				if(data.nickName==""){
					nickName+='<input type="text" placeholder="未知" name="nickName"  required lay-verify="required"  autocomplete="off" class="layui-input">';
				}
				else{
					nickName+='<input type="text"  name="nickName"  required lay-verify="required" value="'+data.nickName+'"  autocomplete="off" class="layui-input">';
				}
				nickName+='</div>';
				
				
				var sname ='<label class="layui-form-label" ">姓名</label>'
					+'<div class="layui-input-inline">';
					if(data.sname==""){
						sname+='<input type="text" placeholder="未知" name="sname"  required lay-verify="required"  autocomplete="off" class="layui-input">';
					}
					else{
						sname+='<input type="text"  name="sname"  required lay-verify="required" value="'+data.sname+'"  autocomplete="off" class="layui-input">';
					}
					sname+='</div>';
			    
				
				
					var ssex='<div class="layui-form-item" >'
					    +'  <label class="layui-form-label">性别</label>'
				        +' <div class="layui-input-block" style="text-align: left; color: black">'		
						+'<input type="radio" name="ssex" value="男" title="男" checked >'
						+'<input type="radio" name="ssex" value="女" title="女" >'
						+'</div></div>'
			     
						var sage ='<label class="layui-form-label" ">年龄</label>'
							+'<div class="layui-input-inline">';
							if(data.sage==""){
								sage+='<input type="text" placeholder="未知" name="sage"  required lay-verify="required"  autocomplete="off" class="layui-input">';
							}
							else{
								sage+='<input type="text"  name="sage"  required lay-verify="required" value="'+data.sage+'"  autocomplete="off" class="layui-input">';
							}
							sage+='</div>';		 
			     
							var address ='<label class="layui-form-label" ">地址</label>'
								+'<div class="layui-input-inline">';
								if(data.address==""){
									address+='<input type="text" placeholder="未知" name="address"  required lay-verify="required"  autocomplete="off" class="layui-input">';
								}
								else{
									address+='<input type="text"  name="address"  required lay-verify="required" value="'+data.address+'"  autocomplete="off" class="layui-input">';
								}
								address+='</div>';
			  	
			
			
			var publicLevel =' <div class="layui-form-item">'
			   +'<label class="layui-form-label">信息级别</label>'
			   +'<div class="layui-input-block" style="text-align: left; color: black">'
			 	+'<select name="publicLevel" lay-verify="required" style="width: 100px">'
			 	+'<option value="0" selected="selected">公开(所有人可见)'+'</option>'
			 	+'<option value="1">好友可见'+'</option>'
			 	+'<option value="2">私密(仅自己可见)'+'</option>'
			 	+'</select>'
			 	
			 	+'</div></div>'		
						
			 	var sintroduction ='<div class="layui-form-item ">'
				    +'<label class="layui-form-label">自我介绍</label>'
				    +'<div class="layui-input-inline" style="width: 70%;">'
				     +' <textarea name="sintroduction"   class="layui-textarea">'+data.sintroduction+'</textarea>'
				   +' </div></div>'	
			
			 	
			 	var botton=' <div class="layui-form-item">'
				         +'<div class="layui-input-block">'
				 	     +'<button class="layui-btn" lay-submit lay-filter="formDemo" onclick="send()">立即提交'
				 	     +'</button>'
				 	     +'<button type="reset" class="layui-btn layui-btn-primary">重置'
				 	     +'</button>'
				 	     +'</div></div>'		
			    
			
				 	    
			
				 	     
				 	     
			
		    content+=
		    '<div class="layui-form-item">'
			+nickName
			+sname+'</div>'
			+ssex		
			+'<div class="layui-form-item">'
			+sage+address
			+'</div>'
			+publicLevel;
			val=sintroduction+botton
			$("#updateMessage").html(content)
			$("#myMessage").html(val)
			  layui.use('form', function(){
				    var form = layui.form;	    
				    form.render(); 
				  });
		
		}	
	});
}








